/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package frmsystem.gui;

import javax.swing.ButtonGroup;
import javax.swing.JDialog;
import javax.swing.JLabel;
import javax.swing.JRadioButton;
import javax.swing.JTextField;
import javax.swing.SpringLayout;

import frmsystem.IDomain;

/**
 *
 * @author bahria
 */
public class RegistrationUI extends JDialog {

    protected SpringLayout layout = new SpringLayout();
    protected JRadioButton chkSavings;
    protected JRadioButton chkCheckings;
    protected JTextField txtName;
    protected JTextField txtStreet;
    protected JTextField txtCity;
    protected JTextField txtState;
    protected JTextField txtZip;
    protected JTextField txtEmail;
    protected ButtonGroup btnGroup = new ButtonGroup();
    
    public RegistrationUI(){
    	getContentPane().setLayout(layout);
    	chkCheckings = new JRadioButton("Checking");
    	btnGroup.add(chkCheckings);
    	getContentPane().add(chkCheckings);
    	layout.putConstraint(SpringLayout.WEST, chkCheckings, 10, SpringLayout.WEST, getContentPane());
    	layout.putConstraint(SpringLayout.NORTH, chkCheckings, 10, SpringLayout.NORTH, getContentPane());
    	
    	chkSavings = new JRadioButton("Savings");
    	btnGroup.add(chkSavings);
    	getContentPane().add(chkSavings);
    	layout.putConstraint(SpringLayout.WEST, chkSavings, 0, SpringLayout.WEST, chkCheckings);
    	layout.putConstraint(SpringLayout.NORTH, chkSavings, 10, SpringLayout.SOUTH, chkCheckings);
    	
    	JLabel lblName = new JLabel("Name:");
    	getContentPane().add(lblName);
    	layout.putConstraint(SpringLayout.WEST, lblName, 0, SpringLayout.WEST, chkSavings);
        layout.putConstraint(SpringLayout.NORTH, lblName, 10, SpringLayout.SOUTH, chkSavings);
        
        txtName = new JTextField(10);
        getContentPane().add(txtName);
        layout.putConstraint(SpringLayout.WEST, txtName, 60, SpringLayout.EAST, lblName);
        layout.putConstraint(SpringLayout.NORTH, txtName, 0, SpringLayout.NORTH, lblName);
        
        JLabel lblStreet = new JLabel("Street:");
    	getContentPane().add(lblStreet);
    	layout.putConstraint(SpringLayout.WEST, lblStreet, 0, SpringLayout.WEST, lblName);
        layout.putConstraint(SpringLayout.NORTH, lblStreet, 10, SpringLayout.SOUTH, lblName);
        
        txtStreet = new JTextField(10);
        getContentPane().add(txtStreet);
        layout.putConstraint(SpringLayout.WEST, txtStreet, 0, SpringLayout.WEST, txtName);
        layout.putConstraint(SpringLayout.NORTH, txtStreet, 0, SpringLayout.NORTH, lblStreet);
        
        JLabel lblCity = new JLabel("City:");
    	getContentPane().add(lblCity);
    	layout.putConstraint(SpringLayout.WEST, lblCity, 0, SpringLayout.WEST, lblStreet);
        layout.putConstraint(SpringLayout.NORTH, lblCity, 10, SpringLayout.SOUTH, lblStreet);
        
        txtCity = new JTextField(10);
        getContentPane().add(txtCity);
        layout.putConstraint(SpringLayout.WEST, txtCity, 0, SpringLayout.WEST, txtName);
        layout.putConstraint(SpringLayout.NORTH, txtCity, 0, SpringLayout.NORTH, lblCity);
        
        JLabel lblState = new JLabel("State:");
    	getContentPane().add(lblState);
    	layout.putConstraint(SpringLayout.WEST, lblState, 0, SpringLayout.WEST, lblCity);
        layout.putConstraint(SpringLayout.NORTH, lblState, 10, SpringLayout.SOUTH, lblCity);
        
        txtState = new JTextField(10);
        getContentPane().add(txtState);
        layout.putConstraint(SpringLayout.WEST, txtState, 0, SpringLayout.WEST, txtName);
        layout.putConstraint(SpringLayout.NORTH, txtState, 0, SpringLayout.NORTH, lblState);
        
        JLabel lblZip = new JLabel("Zip:");
    	getContentPane().add(lblZip);
    	layout.putConstraint(SpringLayout.WEST, lblZip, 0, SpringLayout.WEST, lblState);
        layout.putConstraint(SpringLayout.NORTH, lblZip, 10, SpringLayout.SOUTH, lblState);
        
        txtZip = new JTextField(10);
        getContentPane().add(txtZip);
        layout.putConstraint(SpringLayout.WEST, txtZip, 0, SpringLayout.WEST, txtName);
        layout.putConstraint(SpringLayout.NORTH, txtZip, 0, SpringLayout.NORTH, lblZip);
        
        JLabel lblEmail = new JLabel("Email:");
    	getContentPane().add(lblEmail);
    	layout.putConstraint(SpringLayout.WEST, lblEmail, 0, SpringLayout.WEST, lblZip);
        layout.putConstraint(SpringLayout.NORTH, lblEmail, 10, SpringLayout.SOUTH, lblZip);
        
        txtEmail = new JTextField(10);
        getContentPane().add(txtEmail);
        layout.putConstraint(SpringLayout.WEST, txtEmail, 0, SpringLayout.WEST, txtName);
        layout.putConstraint(SpringLayout.NORTH, txtEmail, 0, SpringLayout.NORTH, lblEmail);
    }

	public JRadioButton getChkSavings() {
		return chkSavings;
	}

	public JRadioButton getChkCheckings() {
		return chkCheckings;
	}

	public JTextField getTxtName() {
		return txtName;
	}

	public JTextField getTxtStreet() {
		return txtStreet;
	}

	public JTextField getTxtCity() {
		return txtCity;
	}

	public JTextField getTxtState() {
		return txtState;
	}

	public JTextField getTxtZip() {
		return txtZip;
	}

	public JTextField getTxtEmail() {
		return txtEmail;
	}
    
}
